<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>{$subcategory_name}资质代办攻略_政策-奇快企服</title>
		<meta name="applicable-device" content="mobile">
		<meta name="keywords" content="{$subcategory_name}资质代办攻略，{$subcategory_name}资质代办政策">
		<meta name="description" content="上奇快企服了解最全{$subcategory_name}代办资质攻略，最新{$subcategory_name}资质代办资讯。为您提供{$year}最新最全的建筑资质信息解读，建筑资质代办攻略以及建筑资质办理政策">
		<meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no,minimal-ui" name="viewport">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<meta content="telephone=no" name="format-detection">
		<!-- UC默认竖屏` UC强制全屏 -->
		<meta name="full-screen" content="yes">
		<meta name="browsermode" content="application">
		<!-- QQ强制竖屏` QQ强制全屏 -->
		<link rel="icon" href="/icon.png">
		<link rel="stylesheet" href="/static/wap/lib/mui.min.css" />

		<link rel="stylesheet" href="/static/wap/css/common.css" />
		<link rel="stylesheet" href="/static/wap/css/consult.css" />

		<link rel="stylesheet" href="/static/wap/css/reset.css" />

		<script type="text/javascript" src="/static/wap/lib/jquery-2.1.4.js"></script>
		<script type="text/javascript" src="/static/wap/lib/mui.min.js"></script>
		<script type="text/javascript" src="/static/index/lib/template.js"></script>
	</head>
	<body>
		<header class="mui-bar mui-bar-nav">
			<a href="/wap/zx/" class="mui-icon mui-icon-back" style="color: #fff;"></a>
			<h1 class="mui-title">奇快企服</h1>
		</header>

		<div class="nav_title" style="margin-top: 48px;">
			<span class="title_name">首页</span>
			<span class="mui-icon mui-icon-forward"></span>
			<span class="title_name">行业资讯</span>
		</div>
		
		<div class="mui-content borderBottom borderTop chooseWrap" style="padding-top: 0;">
			<div class="mui-row">
				<div class="mui-col-sm-6 mui-col-xs-6">
					<div class="mui-table-view-cell tapChoose borderRight" id="catGeryChoose">
						资质类型
					</div>
				</div>
				<div class="mui-col-sm-6 mui-col-xs-6">
					<div class="mui-table-view-cell tapChoose">
						综合排序
					</div>
				</div>
			</div>
		</div>
		
		<div class="consult_container">
			<div id="companyHtml"></div>
			<script id="companyScript" type="text/html">
	    		{{each list item i}} 
	    			<a href="/wap/zx/{{item.id}}" class="list_wrap clearfix">
						<img class="mui-pull-left comp_pic" src="{{item.poster}}"/>
						<div class="right_sec mui-pull-left">
							<div class="top_style">{{item.title}}</div>
							<div class="sub_top_style">
								{{item.desc}}
							</div>
							<div class="bottom_time">
							时间：&nbsp;&nbsp;&nbsp;{{item.create_time}}
							</div>
						</div>
					</a>
	    		{{/each}}
		     </script>
			
		</div>
		
		<div class="page_wrap">
			<div class="page_box">
				<div class="pageItem " onclick="prevPage()">上一页</div>
				<div class="pageItem pageNumBox" id="pageBox">1/4</div>
				<div class="pageItem active" onclick="nextPage()">下一页</div>
			</div>
		</div>
		
		
		{include file="pub/footer"}
		
		<div class="dailogContainer"></div>
		<div class="dailogWrap">
			<div class="listDateWrap">
				<div class="dailogTitle">资质类别</div>

				<ul class="listContainer" id="OneCategoryHtml">
					
				</ul>

			</div>
			<div class="footerDailog">
				<div class="btnBotm cancleDailogBtn">取消</div>
				<div class="btnBotm sureDailogBtn">确定</div>
			</div>
		</div>
		
		<script type="text/javascript" src="/static/index/layer/layer.js"></script>
		<script>
			var baseUrl = 'https://api.qikuai100.com/',
			    categoriesList = { // 所有资质类别重新组成的数据
					name: "资质类别",
					cateList: []
				},
				dId = {$id},
				prevPage = 1, // 当前页
				totalPage = 1, // 总页数
				pageNum = 1;
			$(function(){
				$('#catGeryChoose').click(function(){
					$('.dailogContainer').show();
					$('.dailogWrap').animate({right: "15%"});
				});
				$('.dailogContainer').click(function(){
					$('.dailogContainer').hide();
					$('.dailogWrap').animate({right: "100%"});
				});
				$('.sureDailogBtn').click(function(){
					location.replace(location.href);
				});
				$('.cancleDailogBtn').click(function(){
					window.location.href = '/wap/zxlist/';
				});
				
				initChooseList();
				initDate();
			});

			/**
			 * 资质筛选
			 * **/
			function initChooseList() {
				$.ajax({
					type: "POST",
					url: baseUrl + "api/category/list",
					data: {
						"type": 1
					},
					success: function(result) {
						if(result.ret == 0) {
							var dataL = result;

							for(var i = 0; i < result.data.length; i++) {
								for(var j = 0; j < result.data[i].subcategoy.length; j++) {
									categoriesList.cateList.push(result.data[i].subcategoy[j]);
								}
							}
							var json = {
								category_name: '不限',
								id: ''
							}
							categoriesList.cateList.unshift(json);
							var htmlMore = '';
							for(var i = 0; i < categoriesList.cateList.length; i++) {
								var chooseClass = '';
								categoriesList.cateList[i].id == dId ? chooseClass = 'active' : chooseClass = '';
								
								htmlMore += '<li class="' + chooseClass + '" >' +
									'<a href="/wap/zxlist/' + categoriesList.cateList[i].id + '">' + categoriesList.cateList[i].category_name + '</a>' +
									'</li>';
								
							}
							$('#OneCategoryHtml').html(htmlMore);
						}
					}
				});
			}

			/**
			 * 数据筛选 结果
			 * **/
			function initDate() {
				$.ajax({
					type: "POST",
					url: baseUrl + "api/news/list",
					data: {
						page: pageNum,
						subcategory_id: dId
					},
					success: function(result) {
						if(result.ret == 0) {
							// 公司数据
					        var htmlCompany = template('companyScript',result.data);
					        document.getElementById('companyHtml').innerHTML = htmlCompany;
					        totalPage = result.data.totalPage;
					        currentPage = result.data.currentPage;
					        $('#pageBox').html(currentPage+"/"+totalPage);
						};
					}
				})
			}

			function prevPage(){
				if(currentPage != 1){
					pageNum--;
					initDate();
				}else{
					layer.msg("已经是第一页了")
				}
			}

			function nextPage(){
				if(currentPage != totalPage){
					pageNum++;
					initDate();
				}else{
					layer.msg("已经是最后一页了")
				}
			}
		</script>
		
	</body>
</html>
